﻿<%@ include file="/common/taglibs.jsp"%>
<%@ page language="java" pageEncoding="UTF-8"%>
  <%@ include file="/common/extjs.jsp"%>
<script type="text/javascript" ><!--	

 /** 
 * 附件管理窗口
 */
 function showUploadWin(no)  {
	    
	var projectid ='${(empty param.projectId) ?(projectInfo.projectId):(param.projectId)}';
	 var fid ='${param.fid}';
        if(no ==1){
           var tableName = "mpSuperviseFile";
           var tableField = [['mpSuperviseFile','工程质量监督申请书']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("工程质量监督申请书");
        }else if(no ==2){
        	var tableName = "mpControlFile";
            var tableField = [['mpControlFile','工程概况一览表']
    					 ];
           projectAttachment.init(projectid,fid,tableName,tableField);
           projectAttachment.showUpload("工程概况一览表 ");
          }else if(no ==3){
        	  var tableName = "mpOrganizationPerFile";
          var tableField = [['mpOrganizationPerFile','表项目业主组织机构及人员情况 ']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("表项目业主组织机构及人员情况 ");
        }else if(no ==4){
        	var tableName = "mpSupervisorPerson";
          var tableField = [['mpSupervisorPerson','监理单位人员情况表  ']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("监理单位人员情况表 ");
        }else if(no ==5){
        	var tableName = "mpConstructionPerson";
          var tableField = [['mpConstructionPerson','施工单位人员情况表']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("施工单位人员情况表 ");
        }else if(no ==6){
        	var tableName = "mpSetFile";
          var tableField = [['mpSetFile','工程立项批复文件']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("工程立项批复文件 ");
        }else if(no ==7){
        	var tableName = "mpFirstDesignFile";
          var tableField = [['mpFirstDesignFile','初步设计批复文件']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("初步设计批复文件");
        }else if(no ==8){
        	var tableName = "mpGeologicalInfo";
          var tableField = [['mpGeologicalInfo', '地勘资料']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("地勘资料");
        }else if(no ==9){
        	var tableName = "mpConDesignReply";
          var tableField = [['mpConDesignReply','施工图设计批复文件']
  					 ];
         projectAttachment.init(projectid,fid,tableName,tableField);
         projectAttachment.showUpload("施工图设计批复文件");
        }else if(no ==10){
        	var tableName = "mpConDesignCheck";
          var tableField = [['mpConDesignCheck','施工图设计审查文件']
    				 ];
           projectAttachment.init(projectid,fid,tableName,tableField);
           projectAttachment.showUpload("施工图设计审查文件");
        }else if(no ==11){
        	var tableName = "mpFullProDesign";
              var tableField = [['mpFullProDesign','全套工程设计图纸']
      					 ];
             projectAttachment.init(projectid,fid,tableName,tableField);
             projectAttachment.showUpload("全套工程设计图纸");
        }else if(no ==12){
        	var tableName = "mpLimitedPrice";
               var tableField = [['mpLimitedPrice','财审（造价部门）出具的工程最高限价文件']
       					 ];
              projectAttachment.init(projectid,fid,tableName,tableField);
              projectAttachment.showUpload("财审（造价部门）出具的工程最高限价文件");
        }else if(no ==13){
        	var tableName = "mpDesignBidding";
                 var tableField = [['mpDesignBidding','设计招投标文件']
         					 ];
                projectAttachment.init(projectid,fid,tableName,tableField);
                projectAttachment.showUpload("设计招投标文件");
        }else if(no ==14){
        	var tableName = "mpDesignCopyContract";
                   var tableField = [['mpDesignCopyContract','设计合同副本']
           					 ];
                  projectAttachment.init(projectid,fid,tableName,tableField);
                  projectAttachment.showUpload("设计合同副本");
        }else if(no ==15){
        	var tableName = "mpPetitionFile";
                     var tableField = [['mpPetitionFile','从业单位的资信、资质证明材料']
             					 ];
                    projectAttachment.init(projectid,fid,tableName,tableField);
                    projectAttachment.showUpload("从业单位的资信、资质证明材料");
                   }
   }  


 
Ext.onReady(function(){
  Ext.QuickTips.init();
  var myData = [
                ['1','1','1.建设单位需提供的资料'],
                ['2','1','1)工程质量监督申请书'],
                ['3','1','2)工程概况一览表'],
                ['4','1','3)项目业主组织机构及人员情况'],
                ['5','1','4)监理单位人员情况表'],
                ['6','1','5)施工单位人员情况表'],
                ['7','1','6)工程立项批复文件'],
                ['8','1','7)初步设计批复文件'],
                ['9','1','8)地勘资料'],
                ['10','1','9)施工图设计批复文件'],
                ['11','1','10)施工图设计审查文件'],
                ['12','1','11)全套工程设计图纸'],
                ['13','1','12)财审（造价部门）出具的工程最高限价文件'],
                ['14','1','13)设计招投标文件'],
                ['15','1','14)设计合同副本'],
                ['16','1','15)从业单位的资信、资质证明材料'],
                
                ['1','1','监理招投标文件'],
                ['2','2','监理合同副本'],
                ['3','3','监理单位资信、资质证明材料'],
                ['4','4','监理机构组成、人员资质'],
                ['5','5','监理工作规划、实施细则'],
                ['6','6','*监理中心试验室的仪器设备清单和人员组成'],
                
                ['1','1','施工招投标文件'],
                ['2','2','施工合同副本'],
                ['3','3','施工单位资信、资质证明材料'],
                ['4','4','机构组成人员资质'],
                ['5','5','*质量保证体系'],
                ['6','6','*总体施工组织设计'],
                ['7','7','*经监理批复的单位工程、分部工程、分项工程划分表'],
                ['8','8','*工地试验室仪器设备清单和人员组成']
    ];
     // Record
    MpSupervisionAffix = Ext.data.Record.create([
                                    {name: 'no', type: 'string'},
    								{name: 'kind', type: 'string'},
    								{name: 'file', type: 'string'},
    ]);
    
    // create the data store
    var store = new Ext.data.Store({
        reader: new Ext.data.ArrayReader(
        {
            idIndex: 0  // id for each record will be the first element
        },MpSupervisionAffix)
    });
  store.loadData(myData);
  
  var cm = new Ext.grid.ColumnModel([
       {header: "序号", width: 45, dataIndex: 'no'},
       {header: "kind", width: 75, dataIndex: 'kind',hidden: true},
       {id:'file',header: "建设单位需提供的资料", width: 360, dataIndex: 'file',renderer:Jinyi.project.Format.textAreaRenderer},
       {
					           header:  	'资料查询',
							   align: 'center',
								dataIndex : '',
					           renderer: function(value, metaData, record, rowIndex, colIndex, store) {
					            var no = record.get('no');
					          //  if(no == 2){
					            //    return; 
					           // }
					            var href = "<span class='upload_renderer'><a href='javascript:showUploadWin(\""+no+"\")' >查看资料</a></span>";
					            return href;
					           },  
					           width: 		180
     	 }
  
  ]);
  
   // create the Grid
    var grid = new Ext.grid.GridPanel({
        store: store,
        cm: cm,
        tbar:[{text:"批量下载",handler:function(){
         	 var projectid ='${(empty param.projectId) ?(projectInfo.projectId):(param.projectId)}';
         	 var fid ='${param.fid}';
        	location.href = "${ctx}/attachment/attachment!downloadMany.action?tableId="+fid+"&partId="+projectid;
        }}],
        sm:	new Ext.grid.RowSelectionModel({singleSelect:true}),
        frame:true,
		viewConfig: {
       		forceFit: false,
        	getRowClass: function(record, index) {
   			 }
   			},
        loadMask:true, 
        autoExpandColumn: 'file'
    });
    
    var viewport = new Ext.Viewport({
        layout:'fit',
        items:[grid]
        });
})
--></script>
<body>
<div id="mpSupervisionAffixGrid"></div>
</body>



